package com.timemanage.utils

import androidx.room.Database
import com.timemanage.dao.AppDatabase
import com.timemanage.dao.UserDao
import com.timemanage.entity.User
import com.timemanage.entity.Work


class sqlinit {

//    companion object{
//         fun init():Boolean{
//             var database=AppDatabase.getDatabase(MyApplication.context)
//             var userdao:UserDao=database.userDao();
//             var workDao = database.WorkDao()
//             var user:User?=userdao.selectUser()
//             if(user==null)
//                 return  false
//             else
//             {
//                 user.useName="mhz"
//                 user.userPd="mhz123"
//                 userdao.insertUser(user)
//
//                 var user1:User=userdao.selectUser()
//
//                 var work1:Work?= Work(user1.userId,-1,1,"学习",null,null,null)
//                 var work2:Work?=Work(user1.userId,-1,1,"运动",null,null,null)
//                 var work3:Work?=Work(user1.userId,-1,1,"游戏",null,null,null)
//                 var work4:Work?=Work(user1.userId,-1,1,"工作",null,null,null)
//                 var work5:Work?=Work(user1.userId,1,0,"Android开发","真有趣！",66666666,88888888)
//                 workDao.insertWork(work1)
//                 workDao.insertWork(work2)
//                 workDao.insertWork(work3)
//                 workDao.insertWork(work4)
//                 workDao.insertWork(work5)
//
//             }
//             return true
//
//         }


   // }
}